﻿@echo off

REG ADD    "HKCU\Control Panel\Desktop" /V ScreenSaveActive /T REG_SZ /D 0 /F
REG DELETE "HKCU\Control Panel\Desktop" /V SCRNSAVE.EXE /F
echo 关闭屏幕保护
echo.

sc config defragsvc start= disabled
echo 禁用磁盘碎片整理服务
echo.

powercfg -X disk-timeout-ac      0
powercfg -X disk-timeout-dc      0
echo 从不关闭硬盘

powercfg -X monitor-timeout-ac   0
powercfg -X monitor-timeout-dc   0
echo 从不关闭显示器

powercfg -X standby-timeout-ac   0
powercfg -X standby-timeout-dc   0
echo 从不睡眠

powercfg -X hibernate-timeout-ac 0
powercfg -X hibernate-timeout-dc 0
echo 从不休眠

powercfg -H OFF
echo 关闭休眠
echo.

wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False
wmic pagefileset where "name='c:\\pagefile.sys'" delete
echo 取消页面文件
echo.

;; 查看Trim是否启用
fsutil behavior QUERY DisableDeleteNotify
echo.

pause